package com.youku.plugins.endcardV4New.model.data
{
   import com.youku.interfaces.IPlayerProxy;
   import com.youku.interfaces.IPlayerData;
   
   public class PlayerVideoData extends Object
   {
      
      public function PlayerVideoData(param1:IPlayerProxy) {
         super();
         this._playerProxy = param1;
      }
      
      private var _playerProxy:IPlayerProxy;
      
      public function get videoTitle() : String {
         return this._playerProxy.playerData.videoTitle;
      }
      
      public function get videoLogoURL() : String {
         return this._playerProxy.playerData.videoLogoURL;
      }
      
      public function get videoIdEncode() : String {
         return this._playerProxy.playerData.videoIdEncode;
      }
      
      public function get videoTags() : Array {
         return this._playerProxy.playerData.videoTags;
      }
      
      public function get playerData() : IPlayerData {
         return this._playerProxy.playerData;
      }
      
      public function get up() : int {
         if(UpDownData.upDown == "up")
         {
            return this._playerProxy.playerData.up + 1;
         }
         return this._playerProxy.playerData.up;
      }
      
      public function get down() : int {
         if(UpDownData.upDown == "down")
         {
            return this._playerProxy.playerData.down + 1;
         }
         return this._playerProxy.playerData.down;
      }
      
      public function get upDownFlag() : Boolean {
         var _loc5_:Object = null;
         var _loc6_:* = NaN;
         var _loc1_:* = true;
         var _loc2_:String = this._playerProxy.playerData.videoIdEncode;
         var _loc3_:Array = this._playerProxy.fsoProxy.getUpDownInfo();
         var _loc4_:* = 0;
         while(_loc4_ < _loc3_.length)
         {
            _loc5_ = _loc3_[_loc4_];
            if(_loc2_ == _loc5_["vid"])
            {
               _loc6_ = new Date().getTime();
               if(_loc6_ - _loc5_["time"] > 24 * 60 * 60 * 1000)
               {
                  _loc1_ = true;
               }
               else
               {
                  _loc1_ = false;
               }
            }
            else
            {
               _loc1_ = true;
            }
            _loc4_++;
         }
         return _loc1_;
      }
      
      public function get upDownType() : String {
         var _loc5_:Object = null;
         var _loc1_:* = "";
         var _loc2_:String = this._playerProxy.playerData.videoIdEncode;
         var _loc3_:Array = this._playerProxy.fsoProxy.getUpDownInfo();
         var _loc4_:* = 0;
         while(_loc4_ < _loc3_.length)
         {
            _loc5_ = _loc3_[_loc4_];
            if(_loc2_ == _loc5_["vid"])
            {
               _loc1_ = _loc5_["type"];
            }
            _loc4_++;
         }
         return _loc1_;
      }
   }
}
